package com.oa.user.action;

import com.oa.entity.TblUser;
import com.oa.user.Biz.UserBiz;
import com.oa.util.BaseAction;

import net.sf.json.JSONObject;

public class UserManagerAction extends BaseAction {
	
	private TblUser tblUser;
	private UserBiz userBiz;
	private JSONObject loginMsg;


	/*
	 * 用户登录
	 */
	public String Login()throws Exception{
		String un = request.getParameter("username");
		String pw = request.getParameter("password");
		tblUser = new TblUser();
		tblUser.setUsername(un);
		tblUser.setPassword(pw);
		boolean flag = false;
		flag = this.userBiz.login(tblUser);
		loginMsg = new JSONObject();		
		if(flag){
			
		}else{
			loginMsg.put("loginMsg", "帐号或密码错误！");
		}
		return SUCCESS;
	}
	
	public TblUser getTblUser() {
		return tblUser;
	}

	public void setTblUser(TblUser tblUser) {
		this.tblUser = tblUser;
	}

	public UserBiz getUserBiz() {
		return userBiz;
	}

	public void setUserBiz(UserBiz userBiz) {
		this.userBiz = userBiz;
	}

	public JSONObject getLoginMsg() {
		return loginMsg;
	}

	public void setLoginMsg(JSONObject loginMsg) {
		this.loginMsg = loginMsg;
	}
}
